package com.vita.testCore;

import java.util.Objects;

/**
 * Task是一个 传入类型为TaskExecute<T> 的函数式接口
 */
public interface CvtStep {
    void plan(Execute execute);

    default CvtStep next(CvtStep nextStep) {
        Objects.requireNonNull(nextStep);
//        return (Execute execute) -> {
//            plan(execute);
//            nextStep.plan(execute);
//        };
        return new CvtStep() {
            @Override
            public void plan(Execute execute) {
                plan(execute);
                nextStep.plan(execute);
            }
        };
    }
}
